package com.thread.threadfirst.marvel.citymaster.enums;

import lombok.Getter;

/**
 * 城市状态 0：初始化 1：待开放 2：已开放  3：已下线
 */
@Getter
public enum  CityConfigStatus {

    CCS0(0, "初始化"),
    CCS1(1, "待开放"),
    CCS2(2, "已开放"),
    CCS3(3, "已下线");

    /**
     *
     */
    private final String description;
    /**
     *
     */
    private final Integer value;


    /**
     * @param value
     * @param description
     */
    CityConfigStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }


    /**
     * 根据key获取枚举
     *
     * @param key
     * @return
     */
    public static CityConfigStatus getEnumByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (CityConfigStatus temp : CityConfigStatus.values()) {
            if (temp.value.equals(key)) {
                return temp;
            }
        }
        return null;
    }

}

